﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace PSE.Updater.Common.Configurations.Server
{
    public class UpdateProviders
    {
        private static ProductConfigurationSection _products;
        private static UpdateProviders _product;

        private UpdateProviders() { }
        public static UpdateProviders Instance
        {
            get
            {
                if (_product == null)
                    _product = new UpdateProviders();

                return _product;
            }
        }

        /// <summary>
        /// Retorna as configurações de produtos
        /// </summary>
        /// <returns>Configurações do Updater</returns>
        public ProductConfigurationSection GetSection()
        {
            if (_products == null)
            {
                ProductConfigurationSection section = ConfigurationManager.GetSection("updateProviders") as ProductConfigurationSection;
                _products = section;
            }
            return _products;
        }
    }
}
